\documentclass{article}

\usepackage{tikz}
\begin{document}
\pagestyle{empty}

\def\layersep{2.5cm}

\begin{tikzpicture}[shorten >=1pt,->,draw=black!50, node distance=\layersep]
    \tikzstyle{every pin edge}=[<-,shorten <=1pt]
    \tikzstyle{neuron}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt]
    \tikzstyle{input neuron}=[neuron, fill=green!50];
    \tikzstyle{output neuron}=[neuron, fill=red!50];
    \tikzstyle{hidden neuron}=[neuron, fill=blue!50];
    \tikzstyle{annot} = [text width=4em, text centered]

    % Draw the input layer nodes
    %\foreach \name / \y in {1,...,4}
    % This is the same as writing \foreach \name / \y in {1/1,2/2,3/3,4/4}
        \node[input neuron, pin=left:$x_1$] (I-1) at (0,-1 cm) {};
        \node[input neuron, pin=left:$x_2$] (I-2) at (0,-2 cm) {};
        \node[input neuron, pin=left:$\vdots$] (I-3) at (0,-3 cm) {};
        \node[input neuron, pin=left:$x_n$] (I-4) at (0,-4 cm) {};

    % Draw the hidden layer nodes
%    \foreach \name / \y in {1,...,4}
 %       \path[yshift=0.0cm]
        \node[hidden neuron,pin={[pin edge={->}]right:$+b_1 \to$}] (H-1) at (\layersep,-1 cm) {};
        \node[hidden neuron,pin={[pin edge={->}]right:$+b_2 \to$}] (H-2) at (\layersep,-2 cm) {};
        \node[hidden neuron,pin={[pin edge={->}]right:$\vdots $}] (H-3) at (\layersep,-3 cm) {};
        \node[hidden neuron,pin={[pin edge={->}]right:$+b_n \to$}] (H-4) at (\layersep,-4 cm) {};

    % Draw the output layer node
    \node[output neuron,pin={[pin edge={->}]right:$y_1$}, right of=H-1] (O-1) {};
    \node[output neuron,pin={[pin edge={->}]right:$y_2$}, right of=H-2] (O-2) {};
    \node[output neuron,pin={[pin edge={->}]right:$\vdots$}, right of=H-3] (O-3) {};
    \node[output neuron,pin={[pin edge={->}]right:$y_n$}, right of=H-4] (O-4) {};	
    % Connect every node in the input layer with every node in the
    % hidden layer.
    \foreach \source in {1,...,4}
        \foreach \dest in {1,...,4}
            \path (I-\source) edge (H-\dest);

    % Connect every node in the hidden layer with the output layer
    %\foreach \source in {1,...,4}
     %   \path (H-\source) edge (O-3);

    % Annotate the layers
    \node[annot,above of=H-1, node distance=1cm] (hl) {Hidden layer $W$};
    \node[annot,left of=hl] {Input layer};
    \node[annot,right of=hl] {Output layer};
\end{tikzpicture}
% End of code
\end{document}